Skip to content

fix(database): remove pgx/v4 + pgproto3/v2 CVEs via pgx/v5-only credential-refresh fork#124

Merged
intel352 merged 2 commits into
mainfrom
fix/pgx-v5-fork-20260529
May 30, 2026
Merged

fix(database): remove pgx/v4 + pgproto3/v2 CVEs via pgx/v5-only credential-refresh fork#124
intel352 merged 2 commits into
mainfrom
fix/pgx-v5-fork-20260529

Conversation

@intel352
Copy link
Copy Markdown
Contributor

Properly fixes (not risk-accepts) the two pgx CVEs from the database module — supersedes ADR 0002.

go-db-credential-refresh@v1.2.1's driver package imports pgx/v4/stdlib unconditionally for an optional pgxv4 driver, but this module only uses the pgx driver which the lib already maps to pgx/v5. So pgx/v4 + pgproto3/v2 were dead-but-linked.

  • Forked to github.com/GoCodeAlone/go-db-credential-refresh (v1.3.0 + nested store/awsrds/v1.3.0), dropping the v4 driver + import (pgx/v5/mysql/pq retained).
  • database module + verbose-debug/instance-aware-db examples now directly require the fork (not replace — that doesn't propagate to consumers).
  • go mod tidy drops pgx/v4 + pgproto3/v2 entirely. Repo-wide grep: zero pgx/v4 / pgproto3/v2 in any go.mod/go.sum. Build + race tests pass.

No exclude: every pgx/v4 ≤4.18.3 + pgproto3/v2 ≤2.3.3 version is vulnerable, so exclude only forces a downgrade to another vulnerable version — removing the importer is the fix.

Resolves Dependabot alerts #23#25 + #54#56 (previously dismissed under ADR 0002).

…ntial-refresh fork

Eliminates the two unpatched CVEs (GHSA-jqcq-xjh3-6g23 pgproto3/v2 DoS HIGH,
GHSA-j88v-2chj-qfwx pgx/v4 SQLi low) from the dependency graph instead of
accepting the risk (supersedes ADR 0002).

go-db-credential-refresh@v1.2.1's driver package imports pgx/v4/stdlib
unconditionally for an optional "pgxv4" driver, but this module only uses the
"pgx" driver which already maps to pgx/v5 — so pgx/v4 + pgproto3/v2 were
dead-but-linked. Switched the database module + the verbose-debug /
instance-aware-db examples to a pgx/v5-only fork
(github.com/GoCodeAlone/go-db-credential-refresh v1.3.0 + store/awsrds v1.3.0)
that drops the v4 driver. Direct require (not replace, which doesn't propagate
to consumers); go mod tidy then removes pgx/v4 + pgproto3/v2 entirely.
Repo-wide: zero pgx/v4 / pgproto3/v2 in any go.mod or go.sum. Build + race tests
pass for the database module + both examples.

No go.mod exclude is used: all pgx/v4 (<=4.18.3) + pgproto3/v2 (<=2.3.3)
versions are vulnerable, so exclude only forces a downgrade to another
vulnerable version — removing the importer is what fixes it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 30, 2026

📋 API Contract Changes Summary

No breaking changes detected - only additions and non-breaking modifications

Changed Components:

Core Framework

Contract diff saved to artifacts/diffs/core.json

Module: auth

Contract diff saved to artifacts/diffs/auth.json

Module: cache

Contract diff saved to artifacts/diffs/cache.json

Module: database

Contract diff saved to artifacts/diffs/database.json

Module: eventbus

Contract diff saved to artifacts/diffs/eventbus.json

Module: jsonschema

Contract diff saved to artifacts/diffs/jsonschema.json

Module: letsencrypt

Contract diff saved to artifacts/diffs/letsencrypt.json

Module: reverseproxy

Contract diff saved to artifacts/diffs/reverseproxy.json

Artifacts

📁 Full contract diffs and JSON artifacts are available in the workflow artifacts.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@intel352 intel352 merged commit ebe1d52 into main May 30, 2026
41 checks passed
@intel352 intel352 deleted the fix/pgx-v5-fork-20260529 branch May 30, 2026 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant